<?php echo $header; ?>
<?php if ($error_warning) { ?>

<div class="warning"><?php echo $error_warning; ?></div>
<?php } ?>
<?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content"> <?php echo $content_top; ?>
  <div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
  </div>
  <!-- 商品退换 -->
  <div class="page-header">
    <h1><?php echo $heading_title; ?></h1>
  </div>
  <?php echo $text_description; ?>
  <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" class="form-horizontal">
  	<fieldset>
    <legend><?php echo $text_order; ?></legend>
    <div class="control-group">
      <label class="control-label"><span class="required">*</span> <?php echo $entry_firstname; ?></label>
      <div class="controls">
        <input type="text" name="firstname" value="<?php echo $firstname; ?>" class="large-field" />
        <br />
        <?php if ($error_firstname) { ?>
        <span class="error"><?php echo $error_firstname; ?></span>
        <?php } ?>
      </div>
    </div>
    <div class="control-group">
      <label class="control-label"> <span class="required">*</span> <?php echo $entry_lastname; ?></label>
      <div class="controls">
        <input type="text" name="lastname" value="<?php echo $lastname; ?>" class="large-field" />
        <br />
        <?php if ($error_lastname) { ?>
        <span class="error"><?php echo $error_lastname; ?></span>
        <?php } ?>
      </div>
    </div>
    <div class="control-group">
      <label class="control-label"><span class="required">*</span> <?php echo $entry_email; ?></label>
      <div class="controls">
        <input type="text" name="email" value="<?php echo $email; ?>" class="large-field" />
        <br />
        <?php if ($error_email) { ?>
        <span class="error"><?php echo $error_email; ?></span>
        <?php } ?>
      </div>
    </div>
    <div class="control-group">
      <label class="control-label"><span class="required">*</span> <?php echo $entry_telephone; ?></label>
      <div class="controls">
        <input type="text" name="telephone" value="<?php echo $telephone; ?>" class="large-field" />
        <br />
        <?php if ($error_telephone) { ?>
        <span class="error"><?php echo $error_telephone; ?></span>
        <?php } ?>
      </div>
    </div>
    <div class="control-group">
      <label class="control-label"><span class="required">*</span> <?php echo $entry_order_id; ?></label>
      <div class="controls">
        <input type="text" name="order_id" value="<?php echo $order_id; ?>" class="large-field" />
        <br />
        <?php if ($error_order_id) { ?>
        <span class="error"><?php echo $error_order_id; ?></span>
        <?php } ?>
      </div>
    </div>
    <div class="control-group">
      <label class="control-label"><?php echo $entry_date_ordered; ?></label>
      <div class="controls">
        <input type="text" name="date_ordered" value="<?php echo $date_ordered; ?>" class="large-field date" />
      </div>
    </div>
    </fieldset>
    <fieldset>
    <legend><?php echo $text_product; ?></legend>
    <div id="return-product">
      <div class="content">
        <div class="return-product">
          <div class="control-group">
            <label class="control-label"><span class="required">*</span> <?php echo $entry_product; ?></label>
            <div class="controls">
              <input type="text" name="product" value="<?php echo $product; ?>" />
              <br />
              <?php if ($error_product) { ?>
              <span class="error"><?php echo $error_product; ?></span>
              <?php } ?>
            </div>
          </div>
          <div class="control-group">
            <label class="control-label"><span class="required">*</span> <?php echo $entry_model; ?></label>
            <div class="controls">
              <input type="text" name="model" value="<?php echo $model; ?>" />
              <br />
              <?php if ($error_model) { ?>
              <span class="error"><?php echo $error_model; ?></span>
              <?php } ?>
            </div>
          </div>
          <div class="control-group">
            <label class="control-label"><?php echo $entry_quantity; ?></label>
            <div class="controls">
              <input type="text" name="quantity" value="<?php echo $quantity; ?>" />
            </div>
          </div>
        </div>
        <div class="return-detail">
          <div class="control-group">
            <label class="control-label"><span class="required">*</span> <?php echo $entry_reason; ?></label>
            <div class="controls">
              <?php foreach ($return_reasons as $return_reason) { ?>
              <?php if ($return_reason['return_reason_id'] == $return_reason_id) { ?>
              <label for="return-reason-id<?php echo $return_reason['return_reason_id']; ?>" class="radio">
                <input type="radio" name="return_reason_id" value="<?php echo $return_reason['return_reason_id']; ?>" id="return-reason-id<?php echo $return_reason['return_reason_id']; ?>" checked="checked" />
                <?php echo $return_reason['name']; ?></label>
              <?php } else { ?>
              <label class="radio" for="return-reason-id<?php echo $return_reason['return_reason_id']; ?>">
                <input type="radio" name="return_reason_id" value="<?php echo $return_reason['return_reason_id']; ?>" id="return-reason-id<?php echo $return_reason['return_reason_id']; ?>" />
                <?php echo $return_reason['name']; ?></label>
              <?php  } ?>
              <?php  } ?>
              <?php if ($error_reason) { ?>
              <span class="error"><?php echo $error_reason; ?></span>
              <?php } ?>
            </div>
          </div>
          <div class="control-group">
            <label class="control-label"><?php echo $entry_opened; ?></label>
            <div class="controls">
              <label for="opened" class="radio">
                <?php if ($opened) { ?>
                <input type="radio" name="opened" value="1" id="opened" checked="checked" />
                <?php } else { ?>
                <input type="radio" name="opened" value="1" id="opened" />
                <?php } ?>
                <?php echo $text_yes; ?></label>
              <label for="unopened" class="radio">
                <?php if (!$opened) { ?>
                <input type="radio" name="opened" value="0" id="unopened" checked="checked" />
                <?php } else { ?>
                <input type="radio" name="opened" value="0" id="unopened" />
                <?php } ?>
                <?php echo $text_no; ?></label>
            </div>
          </div>
          <div class="control-group">
            <label class="control-label"><?php echo $entry_fault_detail; ?></label>
            <div class="controls">
              <textarea name="comment" cols="150" rows="6" class="span4"><?php echo $comment; ?></textarea>
            </div>
          </div>
          <div class="control-group">
            <label class="control-label"><?php echo $entry_captcha; ?></label>
            <div class="controls">
              <input type="text" name="captcha" value="<?php echo $captcha; ?>" />
              <br />
              <br />
              <img src="index.php?route=account/return/captcha" alt="" />
              <?php if ($error_captcha) { ?>
              <span class="error"><?php echo $error_captcha; ?></span>
              <?php } ?>
            </div>
          </div>
        </div>
      </div>
    </div>
    </fieldset>
    <div class="buttons form-actions"> <a href="<?php echo $back; ?>" class="btn btn-large"><?php echo $button_back; ?></a>
      <input type="submit" value="<?php echo $button_continue; ?>" class="btn btn-large btn-primary" />
    </div>
    
  </form>
  <?php echo $content_bottom; ?> </div>
<script type="text/javascript"><!--
$(document).ready(function() {
	$('.date').datepicker({dateFormat: 'yy-mm-dd'});
});
//--></script> 
<?php echo $footer; ?>